#!/bin/bash
########################################################################
# gmould - GMOULD main entry
# Copyright (C) 2013 Mohamad Afifi Omar <afifio@gmail.com>
#
# These comments cannot be remove or edited and should remain intact
# because this file comments is an extension to the GPL3 license.
# This software file is covered by GPL version 3 license.
# Please see the LICENSE and gpl3.txt or gpl3.htm in doc directory
# for the license agreement, if its not exist, write to the 
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# Modification below this line is allowed
########################################################################
# Extra credits to:
#
########################################################################
# Notes:
# Put notes to other future developer/contributor here
#
########################################################################
#define gtkdialog
if [ "`which gtkdialog4`" ]; then
 GTKDIALOG=gtkdialog4
elif [ "`which gtkdialog3`" ]; then
 GTKDIALOG=gtkdialog3
else
 GTKDIALOG=gtkdialog
fi
export PROGNAME=gmould

export PROGVER=20130301
if [ -d "/usr/share/gmould" ]
then
	export GMOULDDIR=/usr/share/gmould
	#gmoulddev hardcoded for gmould development
	#export GMOULDDIR=/root/projects/gmould
	export PROGDIR=/usr/share/$PROGNAME
else
	export GMOULDDIR=/root/projects/gmould
	export PROGDIR=/root/projects/$PROGNAME
fi
export PROGDLG=$PROGDIR/dlg
export PROGDOC=$PROGDIR/doc
export PROGLIB=$PROGDIR/lib
export PROGPIX=$PROGDIR/pix
export PROGDATA=$PROGDIR/data
export PROGTMP=$HOME/.config/$PROGNAME/tmp
export PROGPREF=$HOME/.config/$PROGNAME/preference
export PROGAUTHOR="Mohamad Afifi Omar"
export PROGEMAIL="afifio@gmail.com"
mkdir -p "$PROGTMP"
mkdir -p "$PROGPREF"
export DEBUG=true
source $PROGLIB/common.sh
source $PROGLIB/constant.sh
source $GMOULDDIR/dlg/SelectProject.dlg
$GTKDIALOG --center --program=DLG_SelectProject
source `cat $PROGPREF/activeproject`
export PROJECTDIR=$PROJECTBASEPATH
#export PROJECTDIR=$GMOULDDIR
bootstrap
# version = date +%Y%m%d
#echo $MAIN_DIALOG > /root/projects/gmould/out.xml
$GTKDIALOG --center --program=MAIN_DIALOG
